package com.xinxin.o2o.service;

import com.xinxin.o2o.dto.ProductCategoryExecution;
import com.xinxin.o2o.exceptions.ProductCategoryOperationException;
import com.xinxin.o2o.model.ProductCategory;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 史鑫鑫
 * @date 2019-08-19 17:42
 */
@Service
public interface ProductCategoryService {

    /**
     * 插入产品分类
     *
     * @param productCategory 产品分类
     * @return 插入结果
     */
    int insertProductCategory(ProductCategory productCategory);

    /**
     * 批量添加产品分类
     *
     * @param productCategoryList 产品分类
     * @return 添加状态
     * @throws ProductCategoryOperationException 异常
     */
    ProductCategoryExecution batchAddProductCategory(List<ProductCategory> productCategoryList) throws ProductCategoryOperationException;

    /**
     * 查询产品分类
     *
     * @param shopId 店铺id
     * @return 产品分类列表
     */
    List queryProductCategoryList(Long shopId);

    /**
     * 删除产品分类
     *
     * @param productCategoryId 分类id
     * @param shopId            店铺id
     * @return 影响行数
     * @throws ProductCategoryOperationException 异常
     */
    ProductCategoryExecution deleteProductCategory(long productCategoryId, long shopId) throws ProductCategoryOperationException;
}
